Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(ICRC_Ledger): FI-1589: Adapt icrc golden state tests to ledger V3 stable structures migration #2739

Merged
merged 146 commits into from
Nov 28, 2024

Conversation

mbjorkqvist
Copy link
Member

The ICRC ledger does not support downgrading once allowances have been migrated to stable structures. This PR adapts the golden state tests accordingly.

@github-actions github-actions bot added the test label Nov 21, 2024
@mbjorkqvist mbjorkqvist force-pushed the mathias-FI-1589-adapt-icrc-golden-state-tests-to-V3 branch from fb22395 to e96ab18 Compare November 21, 2024 12:24
@mbjorkqvist
Copy link
Member Author

The ICRC golden state tests succeeded for commit 0627938 here.

@mbjorkqvist mbjorkqvist marked this pull request as ready for review November 21, 2024 21:03
@mbjorkqvist mbjorkqvist requested review from a team as code owners November 21, 2024 21:03
@aterga
Copy link
Contributor

aterga commented Nov 21, 2024

@mbjorkqvist
Copy link
Member Author

Should we also adopt the tests from https://sourcegraph.com/github.com/dfinity/ic/-/blob/rs/nervous_system/integration_tests/tests/sns_ledger_upgrade.rs?L29 ?

From a quick glance, neither of those test would seem to need updating, since they both first install the SNS using the mainnet canister versions (which is the latest blessed versions, i.e., for the ledger, "V2", which writes the ledger state using the MemoryManager in the pre_upgrade).

The problem is with (SNS) ledgers that haven't upgraded to V2, since we don't support upgrading from a pre-V2 version to V3 or later (to migrate the Allowances in V3 to a virtual memory managed by the MemoryManager, the ledger state must have been written using the MemoryManager in the pre_upgrade of the previous ledger version, and this is only done from V2 onwards).

Since SNSs can (currently?) only upgrade one version at a time, and not skip versions, there shouldn't be any issues, but let's perhaps sync offline to see if there are any potential gaps that we haven't considered.

Base automatically changed from maciej-icrc-v3 to master November 28, 2024 12:54
…sts-to-V3

# Conflicts:
#	Cargo.lock
#	packages/icrc-ledger-types/src/icrc1/account.rs
#	rs/ledger_suite/icrc1/ledger/src/lib.rs
#	rs/ledger_suite/icrc1/ledger/src/main.rs
#	rs/ledger_suite/icrc1/ledger/tests/tests.rs
#	rs/ledger_suite/icrc1/tests/upgrade_downgrade.rs
#	rs/ledger_suite/icrc1/tokens_u256/BUILD.bazel
#	rs/ledger_suite/icrc1/tokens_u256/Cargo.toml
#	rs/ledger_suite/icrc1/tokens_u256/src/lib.rs
#	rs/ledger_suite/tests/sm-tests/src/lib.rs
@mbjorkqvist mbjorkqvist added this pull request to the merge queue Nov 28, 2024
Merged via the queue into master with commit 2190613 Nov 28, 2024
24 checks passed
@mbjorkqvist mbjorkqvist deleted the mathias-FI-1589-adapt-icrc-golden-state-tests-to-V3 branch November 28, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants